1. Field of the Invention
The present invention relates to a programming assist device for a programmable logic controller program and a programming assist method for a programmable logic controller program.
2. Description of the Related Art
A programmable logic controller (hereinafter referred to as “PLC”) is used to control automated machinery in a factory or the like. The PLC includes a central processing unit (hereinafter referred to as “CPU”) that is a small computer and that executes a program. A ladder language that describes sequence control in the form of a ladder circuit is used to prepare the program. The ladder language may be rewritten as appropriate into a sequence program that matches the usage. The PLC receives a signal (on or off information) about a continuous state input from a variety of input devices (such as switches and sensors). The PLC controls (e.g. outputs an on or off signal to) output devices (such as relays and motors) using the sequence program in which the variety of input devices are combined in a desired form (connected in series or in parallel).
PLCs called safety PLCs are provided with redundant CPUs and ROMs. The two ROMs are loaded with separate executable files (codes, namely programs, written in a machine language that is executable by the PLCs) prepared from an identical ladder language program. In the case where outputs from the redundant CPUs match each other, the outputs are used to control output devices such as motors and relays. That is, two different executable files prepared from an identical ladder language program are executed by separate CPUs, and outputs from the CPUs are collated with each other to prevent occurrence of an emergency stop in the case where there is any unexpected failure in software for conversion from the ladder language program to the executable files or the like.
In the related art, in preparing separate executable files, an intermediate code converter (converter software) is used to convert the ladder language program into an intermediate code (a program written in an intermediate language), and the intermediate code is verified by a designer sentence by sentence to check the presence or absence of any failure in conversion. The intermediate code is then converted into a first executable file by a first executable file converter (converter software), and into a second executable file by a second executable file. The first executable file is loaded into a first CPU, and the second executable file is loaded into a second CPU.
Japanese Patent Application Publication No. 2006-235660 (JP 2006-235660 A) discloses a control system in which a numerical data program rather than executable files is transferred to a PLC and the PLC includes an interpreter program that interprets the numerical data program command by command to execute the numerical data program. In the configuration, the PLC does not directly execute the numerical data program, but executes the content of an interpretation (a translation into a machine language) by the interpreter program.
Japanese Patent Application Publication No. 9-212212 discloses a collation method for a sequence circuit capable of recognizing a contradiction in logic or an overlap in logic by extracting sequences A and B from a ladder sequence 3 prepared by synthesizing a standard ladder sequence 1 for equipment 1E and a standard ladder sequence 2 for equipment 2E, for example, mnemonically developing the sequences A and B for each block (into a combination of English words and symbols translated from a machine language in such a manner that is easily understandable and describable by humans), logically expressing the developed sequences, sorting the sequences in the order of their addresses, and comparing the sequences with each other.
In the method according to the related art in which a ladder language program is converted into an intermediate code and a first executable file and a second executable file are prepared from the intermediate code resulting from the conversion, it takes significantly much time and effort for a designer to verify the intermediate code resulting from the conversion from the ladder language program sentence by sentence, which is not preferable. In addition, although two types of executable file converter are prepared to prepare separate executable files from one intermediate code, only one type of conversion from the ladder language program into an intermediate code is used. Thus, in the case where there is any failure in an intermediate code converter (converter software) that converts the ladder language program into an intermediate code, the failure may not be discovered even if the designer verifies the intermediate code sentence by sentence, and an emergency stop of a PLC due to an error in executable files may be caused, which is not preferable.
As opposed to the method described above, it is also conceivable to prepare two types of intermediate code converter (converter software) to prepare separate intermediate codes from one ladder language program, and to prepare separate executable files from the two types of intermediate code using two types of executable file converters (converter software). In order to maintain the series of programs, however, it is necessary to save the ladder language program, which requires a large storage capacity and thus is not preferable (a ladder language program has a significantly large size compared to intermediate codes and executable files). Alternatively, the two types of intermediate code may be saved instead of saving the ladder language program. However, saving the two types of intermediate code requires an extra storage capacity (compared to a case where one type of intermediate code is saved), which is not preferable.
Meanwhile, the control system described in JP 2006-235660 A addresses a special PLC loaded with an interpreter program, and operates slower than a PLC that is loaded with an executable file in a machine language and directly operates on the machine language. In the case where the redundant CPUs of the safety PLC are loaded with an interpreter program and different numerical data programs, the difference in operating time since interpretation until execution of the numerical data programs may be large, which is not preferable.
The collation method for a sequence circuit described in JP 9-212212 A may not be applied as a method in which the redundant CPUs of the safety PLC are loaded with separate executable files.